<h1><?php print( $h1 ); ?></h1>
<?php
//@todo: load by domain -> website
$templatepath = "template/trassenheide/";

//check in 24 values
$entity = array( "0" => "k. A.",
                 "1" => "p. P.",
                 "2" => "p. P. / DZ",
                 "3" => "Whg",
                 "5" => "p. P. / Whg.",
		 "6" => "EZ",
		 "7" => "DZ",
		 "8" => "DZ + 1 Aufb.",
		 "9" => "DZ + 2 Aufb.",
		 "10" => "DZ + 3 Aufb.",
		 "11" => "Bungalow",
		 "12" => "Haus",
		 "4" => "Zimmer"
          );
$season = array( "1" => "HS",
                 "2" => "MS",
                 "3" => "NS"
          );
$guests = array( "0" => "k. A.",
                 "1" => "1",
                 "2" => "2",
                 "21" => "2 + 1",
                 "22" => "2 + 2",
                 "23" => "2 + 3",
                 "24" => "2 + 4",
                 "3" => "3",
                 "31" => "3 + 1",
                 "4" => "4",
                 "41" => "4 + 1",
                 "5" => "5",
                 "6" => "6",
                 "7" => "7",
                 "8" => "8",
                 "9" => "9",
                 "10" => "10",
                 "11" => "11",
                 "12" => "12",
                 "13" => "13",
                 "14" => "14",
                 "15" => "15",
                 "16" => "16",
                 "17" => "17",
                 "18" => "18",
                 "19" => "19",
          );

if( !empty( $text ) ){
	foreach( $text as $key => $value ){
		?>
		<div class="checkin24">
		<table width="528" border="0" cellpadding="0" cellspacing="0" class="Rah01">
		  <tr> 
		    <td width="526" height="30" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0" class="Rah02Head">
		        <!--DWLayoutTable-->
		        <tr> 
		          <td width="366" height="30" valign="top" class="LesTex"><span class="LesTexFe"><?php echo $value['typedesc']; ?>:</span> 
		            &quot;<?php echo $value['title']; ?>&quot;</td>
		          <td width="158" valign="top" class="LesTexRe"><span class="LesTexFe">Lage:</span> <a href="<?php echo site_url( );?>/welcome/page/ortsplan" style="text-decoration:none;">Ortsplan <img src="<?php echo DEVPATH.$templatepath;?>images/lupe.png" width="11" height="11"></a> </td>
		        </tr>
		      </table></td>
		  </tr>
		  <tr> 
		    <td height="135" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0" class="Rah03">
		        <!--DWLayoutTable-->
		        <tr> 
		          <td width="200" height="135" valign="top" class="MiMi">
					<?php if( @fopen( 'http://checkin24.eu/customer/images/thumbs/'. $value['id'] .'_summer.jpg', 'r' ) ){ ?>
		          	<img src="http://checkin24.eu/wsdl/image.php?file=<?php echo $value['id']; ?>_summer.jpg&imageWidth=180" width="180" height="115" alt="<?php echo $value['title']; ?>">
		          	<?php } else { ?>
		          	<img src="http://checkin24.eu/pic/main/pichotel.jpg" width="180" height="115" alt="<?php echo $value['title']; ?>">
		          	<?php } //else ?>
		          </td>
		          <td width="326" valign="top" class="LesTexAdre"><span class="LesTexFe"><?php echo $value['title']; ?></span><br>
					<?php if( !empty( $value['contact'] ) ) { ?>
		            Inh. <?php echo $value['contact']; ?><br>
		            <?php } //if ?>
		            <?php if( !empty( $value['street'] ) ) { echo $value['street'] ." | "; } ?> 
			    <?php if( !empty( $value['zip'] ) ) { echo $value['zip']; } ?> 
			    <?php if( !empty( $value['city'] ) ) { echo $value['city']; } ?><br>
		            <?php if( $value['phone'] != '//' ){ ?>
		            Tel: <?php echo $value['phone']; 
			    } //if  
		            if( $value['fax'] != '//' ){ ?>
		            | Fax: <?php echo $value['fax']; 
		            } //if ?>
		            <?php if( $value['mobil'] != '//' ){ ?>
		            | Handy: <?php echo $value['mobil']; 
			    } //if ?> 
			    <br />
			    <br />
		            <p>
		            	<?php if( !empty( $value['homepage'] ) ) {?>
		            	Internet: <a href="http://<?php echo $value['homepage']; ?>" target="_blank"><?php echo $value['homepage']; ?></a><br>
		              	<?php 
						} //if 
		              	if( !empty( $value['email'] ) ) {?>
		            	e-Mail: <a href="mailto:<?php echo $value['email'];?>"><?php echo $value['email'];?></a>
		            	<?php  
		              	} ?>
		            </p>
		            </td>
		          </tr>
		      </table></td>
		  </tr>
		  <tr> 
		    <td height="30" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0" class="Rah04">
		        <!--DWLayoutTable-->
		        <tr> 
		          <td width="250" height="30" valign="top" class="LesTex">
		          <?php if( !empty( $value['price'] ) ){ ?>
		          	<span class="LesTexFe">Preis:</span> 
		            ab <?php echo $value['price'] ." " . $value['currency'] ." " . $entity[$value['entity']]; if( !empty( $value['season'] ) ){ echo " / " .$season[$value['season']]; } ?>
		          <?php } //if?>
		          </td>
		          <td width="110" valign="top" class="LesTex">
		          <?php if( !empty( $value['guests'] ) ){ ?>
		          	<span class="LesTexFe">Personen:</span> 
		           	<?php echo $guests[$value['guests']]; ?>
		          <?php } //if ?>
		          </td>
		          <td width="166" valign="top" class="LesTexRe">
		          <script type="text/javascript">
		          	$(document).ready(function() {
		          		$('#more_info<?php echo $key; ?>').hide();
		          		// shows the slickbox on clicking the noted link  
		          		$('a#more<?php echo $key; ?>').click(function() {
		          			$('#more_info<?php echo $key; ?>').show('slow');
		          			return false;
		          		});
		          	});     
		          </script>
		          <?php if( !empty( $value['information'] ) && !empty( $value['description'] ) ){ ?>
		          	<a href="" id="more<?php echo $key; ?>" style="text-decoration:none;"><strong><font color="#de3d00"> + 
		            mehr Informationen </font></strong></a>
		          <?php }//if?>  
		          </td>
		        </tr>
		      </table> 
		      <?php if( !empty( $value['information'] ) ){ ?>
		        <div id="more_info<?php echo $key; ?>" style="margin:10px;text-align:center;">
		        <table width="500px" border="0" cellpadding="0" cellspacing="0">
			    <tr>
			   	  <td colspan="3"><?php if( !empty( $value['description'] ) ){ echo nl2br( $value['description'] ); } ?></td>
			    </tr>
			    <tr>
			    <td width="176" height="25" bgcolor="#f1f7d9">
			    	<?php 
				if( !empty( $value['images'] ) ) {
					$images = unserialize( $value['images'] );
				}
				?>
				<strong>
			    		<span style="font-size: smaller;">
			    			<span style="color: rgb(126, 138, 80);"><?php if( !empty( $images['image_winter'] ) ) echo $images['image_winter']; ?></span>
			    		</span>
			    	</strong>
			    </td>
			    <td width="176" height="25" bgcolor="#f1f7d9">
			    	<strong>
			    		<span style="font-size: smaller;">
			    			<span style="color: rgb(126, 138, 80);"><?php if( !empty( $images['image_area'] ) ) echo $images['image_area']; ?></span>
			    		</span>
			    	</strong>
			    </td>
			    <td width="176" height="25" bgcolor="#f1f7d9">
			    	<strong>
			    		<span style="font-size: smaller;">
			    			<span style="color: rgb(126, 138, 80);"><?php if( !empty( $images['image_hobby'] ) ) echo $images['image_hobby']; ?></span>
			    		</span>
			    	</strong>
			    </td>
			    </tr>
			    <tr>
			    	<td>
				    	<?php if( @fopen( 'http://checkin24.eu/customer/images/thumbs/'. $value['id'] .'_winter.jpg', 'r' ) ){ ?>
			          	<a href="http://checkin24.eu/customer/images/thumbs/<?php echo $value['id']; ?>_winter.jpg">	
			          		<img src="http://checkin24.eu/customer/images/thumbs/<?php echo $value['id']; ?>_winter.jpg" width="160" height="110" alt="<?php echo $value['title']; ?>">
			          	</a>
			          	<?php } else { ?>
			          	<img src="http://checkin24.eu/pic/main/pichotel.jpg" width="160" height="110" alt="<?php echo $value['title']; ?>">
			          	<?php } //else ?>
			        </td>
			    	<td>
				    	<?php if( @fopen( 'http://checkin24.eu/customer/images/thumbs/'. $value['id'] .'_area.jpg', 'r' ) ){ ?>
			          	<a href="http://checkin24.eu/customer/images/thumbs/<?php echo $value['id']; ?>_area.jpg">	
			          		<img src="http://checkin24.eu/customer/images/thumbs/<?php echo $value['id']; ?>_area.jpg" width="160" height="110" alt="<?php echo $value['title']; ?>">
			          	</a>
				    	<?php } else { ?>
			          	<img src="http://checkin24.eu/pic/main/pichotel.jpg" width="160" height="110" alt="<?php echo $value['title']; ?>">
			          	<?php } //else ?>
			    	</td>
			    	<td>
				    	<?php if( @fopen( 'http://checkin24.eu/customer/images/thumbs/'. $value['id'] .'_hobby.jpg', 'r' ) ){ ?>
			          	<a href="http://checkin24.eu/customer/images/thumbs/<?php echo $value['id']; ?>_hobby.jpg">	
			          		<img src="http://checkin24.eu/customer/images/thumbs/<?php echo $value['id']; ?>_hobby.jpg" width="160" height="110" alt="<?php echo $value['title']; ?>">
			          	</a>
				    	<?php } else { ?>
			          	<img src="http://checkin24.eu/pic/main/pichotel.jpg" width="160" height="110" alt="<?php echo $value['title']; ?>">
			          	<?php } //else ?>
			    	</td>
			    </tr>
			    </table>
			    </div>
			  <?php } //if?>
			 </td>
		  </tr>
		</table>
		</div>
		<?php 
	}
}
?>
